import request from '@/utils/request.js'

/* ============= 供应商管理 start =============*/
export function getVendorList(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/index.php/api/Vendorchecklist/getVendorList',
    params: data,
    methods: 'get'
  })
}

export function typeVendorList(id, type, thisStatus, thisStatusName) {
  /*
  * type 1 审核
  * type 2 停用
  * type del 删除
  * */
  const data = {
    id,
    type,
    thisStatus,
    thisStatusName
  };
  return request({
    url: '/index.php/api/Vendorchecklist/TypeVendorList',
    params: data,
    methods: 'get'
  })
}

/* ============= 供应商管理 end ============= */


/* ============= 供应商审核 start =============*/

// 获取列表页面
export function getCheckList(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: 'api/Vendorchecklist/getCheckList',
    params: data,
    methods: 'get'
  })
}

// 审核
export function typeCheckList({id, type, level}) {
  const data = {
    id,
    type,
    level
  }
  return request({
    url: 'api/Vendorchecklist/TypeCheckList',
    params: data,
    methods: 'get'
  })
}

/* ============= 供应商审核 end =============*/


/* ============= 物料列表 start =============*/
export function getInventorylist(page, listRows = 15) {
  const data = {
    page,
    listRows
  }
  return request({
    url: 'api/Inventory/getlist',
    params: data,
    methods: 'get'
  })
}

/* 物料列表 start */
export function verify(id, type) {
  const data = {
    id,
    type
  };
  return request({
    url: 'api/Inventory/verify',
    params: data,
    methods: 'get'
  })
}

export function Inventory_delete(id) {
  const data = {
    id
  };
  return request({
    url: 'api/Inventory/delete',
    params: data,
    methods: 'get'
  })
}

/* ============= 物料列表 end =============*/


/* ============= 项目部位管理 start =============*/

// 获取列表页面数据
export function project_getlist(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: 'api/Project/getlist',
    params: data,
    methods: 'get'
  })
}

// 获取删除列表数据
export function project_delete(id) {
  const data = {
    id
  }
  return request({
    url: '/api/Project/delete',
    params: data,
    methods: 'get'
  })
}

/* ============= 项目部位管理 end =============*/


/* ============= 需求计划 start =============*/

// 获取需求计划列表数据
export function plan_getlist(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: 'api/Plan/getlist',
    params: data,
    methods: 'get'
  })
}

// 删除需求计划列表数据
export function plan_delete(id) {
  const data = {
    id
  }
  return request({
    url: '/api/Plan/delete',
    params: data,
    methods: 'get'
  })
}

/* ============= 需求计划 end =============*/

/* ============= 采购计划 start =============*/
export function purchase_getlist(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: '/api/Purchase/getlist',
    params: data,
    methods: 'get'
  })
}

// 采购计划删除接口
export function purchase_delete(id) {
  const data = {
    id
  }
  return request({
    url: '/api/Purchase/delete',
    params: data,
    methods: 'get'
  })
}

/* ============= 采购计划 end =============*/


/* ============= 采购方案 start =============*/
export function programma_getlist(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: '/api/Programma/getlist',
    params: data,
    methods: 'get'
  })
}

// 删除需求计划列表数据
export function programma_delete(id) {
  const data = {
    id
  }
  return request({
    url: '/api/Programma/delete',
    params: data,
    methods: 'get'
  })
}


/* ============= 采购方案 end =============*/


/* ============= 采购方式管理 start =============*/

/* ============= 公告列表 start =============*/
export function getsingleSourceData(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: '/api/single/index',
    params: data,
    methods: 'get'
  })
}

/* ============= 公告列表 end =============*/

/* ============= 中标公示 start =============*/
export function getsingle_bidpublicity(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: '/api/single/bidpublicity',
    params: data,
    methods: 'get'
  })
}
/* ============= 中标公示 end =============*/















/* ============= 询价列表 start =============*/
export function consultprice_index(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: '/api/consultprice/index',
    params: data,
    methods: 'get'
  })
}

/* ============= 询价列表 end =============*/













/* ============= 询价中标公示 start =============*/
export function negotiate_bidpublicity(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: '/api/consultprice/bidpublicity',
    params: data,
    methods: 'get'
  })
}

/* ============= 询价中标公示 end =============*/









/* ============= 谈判列表 start =============*/

export function negotiate_index(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: '/api/negotiate/index',
    params: data,
    methods: 'get'
  })
}

/* ============= 谈判列表 end =============*/








/* ============= 中标公示列表 start =============*/

export function bidpublicity(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: '/api/negotiate/bidpublicity',
    params: data,
    methods: 'get'
  })
}

/* ============= 中标公示列表 end =============*/





/* ============= 采购方式管理 end =============*/
/* ============= 合同管理 start =============*/

// 获取合同列表数据
export function getcontract_index(id) {
  const data = {id};
  return request({
    url: 'api/contract/index',
    params: data,
    methods: 'get'
  })
}

// 合同列表作废
export function contract_delete(id) {
  const data = {id};
  return request({
    url: 'api/contract/delete',
    params: data,
    methods: 'get'
  })
}

/* ============= 合同管理 end =============*/


/* ============= 采购管理 start =============*/

/* ============= 到货单 start =============*/
export function getarrivalorderlist(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: 'api/supplypurchase/arrivalorderlist',
    params: data,
    methods: 'get'
  })
}

/* ============= 到货单 end =============*/

/* ============= 待检单 start =============*/
export function getwaitingAreaList(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: 'api/supplypurchase/waitingAreaList',
    params: data,
    methods: 'get'
  })
}

/* ============= 待检单 end =============*/

/* ============= 质检单 start =============*/
export function getqualityinspectionlist(page, listRows = 10) {
  const data = {
    page,
    listRows
  }
  return request({
    url: 'api/supplypurchase/qualityinspectionlist',
    params: data,
    methods: 'get'
  })
}

/* ============= 质检单 end =============*/

/* ============= 退货单 start =============*/
export function getreturnSlipList(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: 'api/supplypurchase/returnSlipList',
    params: data,
    methods: 'get'
  })
}

/* ============= 退货单 end =============*/
/* ============= 采购管理 end =============*/


/* ============= 库存管理 start =============*/

/* ============= 入库管理 start =============*/
export function getComeList(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/Putinhouse/getComeList',
    params: data,
    methods: 'get'
  })
}

/* ============= 入库管理 end =============*/

/* ============= 出库管理 start =============*/
export function warehouse_management(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/Putinhouse/getOutList',
    params: data,
    methods: 'get'
  })
}

/* ============= 出库管理 end =============*/

/* ============= 库存管理 end =============*/


/* ============= 仓库管理 start =============*/

/* ============= 仓库列表 start =============*/
export function getwarehouse(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/warehouse/index',
    params: data,
    methods: 'get'
  })
}

/* ============= 仓库列表 end =============*/

/* ============= 仓库盘点 start =============*/
export function getwarehouse_inventory(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/Inventorywh/index',
    params: data,
    methods: 'get'
  })
}

/* ============= 仓库盘点 end =============*/

/* ============= 仓库调拨 start =============*/
export function getAllocations_index(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/Allocations/index',
    params: data,
    methods: 'get'
  })
}

/* ============= 仓库调拨 end =============*/

/* ============= 仓库管理 end =============*/


/* 采购寻源工具与方案 -> 竞价比 start*/
/* 竞价比 -> 审核公告 start */
export function getbidding_noticelist(page, listRows = 10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/bidding/noticelist',
    params: data,
    methods: 'get'
  })
}
/* 竞价比 -> 审核公告 end */

/* 竞价比 -> 资格预审 start */
export function getbidding_inquirylist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/bidding/inquirylist',
    params: data,
    methods: 'get'
  })
}
/* 竞价比 -> 资格预审 end */
/* 竞价比 -> 结果公示 start */
export function getbidding_zbgslist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/bidding/zbgslist',
    params: data,
    methods: 'get'
  })
}
/* 竞价比 -> 结果公示 end */
/* 采购寻源工具与方案 -> 竞价比 end*/


/* 招投标 start */

// 信息汇总
export function bid_allbidslist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/bid/allbidslist',
    params: data,
    methods: 'get'
  })
}

// 状态管理
export function bid_statuslist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/bid/statuslist',
    params: data,
    methods: 'get'
  })
}

export function bid_modifyStatus(id,type) {
  const data = {
    id,
    type
  }
  return request({
    url: '/api/bid/modifyStatus',
    params: data,
    methods: 'get'
  })
}

// 审核公告
export function bid_noticelist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/bid/noticelist',
    params: data,
    methods: 'get'
  })
}

// 资格预审
export function bid_inquirylist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/bid/inquirylist',
    params: data,
    methods: 'get'
  })
}

// 发布标书
export function bid_sendbidslist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/bid/sendbidslist',
    params: data,
    methods: 'get'
  })
}

// 招标管理
export function invitebids_getlist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/Invitebids/getlist',
    params: data,
    methods: 'get'
  })
}

// 评标设置
export function invitebids_evalubid(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/Invitebids/evalubid',
    params: data,
    methods: 'get'
  })
}

// 中标公示
export function invitebids_bidpublicitylist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/Invitebids/bidpublicitylist',
    params: data,
    methods: 'get'
  })
}

// 招标完成
export function invitebids_bidendlist(page, listRows=10) {
  const data = {
    page,
    listRows
  };
  return request({
    url: '/api/Invitebids/bidendlist',
    params: data,
    methods: 'get'
  })
}
/* 招投标 end */





// 查看资格预审
// 请求方法: GET
// 接口地址: index.php/api/bidding/prequalification
export function bidding_prequalification(data) {
  return request({
    url:'index.php/api/bidding/prequalification',
    method: 'get',
    params: data
  })
}
